package com.mxx.common.netty.http.resolvers;

import com.mxx.common.conv.JacksonConverter;
import com.mxx.common.netty.http.NettyHttpRequest;
import com.mxx.common.netty.http.NettyMethod;
import com.mxx.common.netty.http.NettyMethodParameter;
import org.springframework.stereotype.Component;

import java.io.IOException;

/**
 * @Auther: Mr. Zeng
 * @Date: 2020/8/4 11:18
 * @Description: 暂无描述
 */

@Component
public class RequestResolvers extends AbstractNettyResolvers {


    public RequestResolvers(JacksonConverter jacksonConverter) {
        super( jacksonConverter);
    }

    @Override
    public boolean match(NettyMethod nettyMethod, NettyMethodParameter methodParameter) {
        if (methodParameter.getType().equals(NettyHttpRequest.class)) {
            return true;
        }
        return false;
    }

    @Override
    public Object resolvers(NettyMethod nettyMethod, NettyHttpRequest request, NettyMethodParameter methodParameter) throws IOException {
        return request;
    }


}
